package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.annotation.AutoFill;
import com.itheima.enumeration.OperationType;
import com.itheima.pojo.entity.Emp;
import com.itheima.pojo.dto.EmpQuery;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface EmpMapper extends BaseMapper<Emp> {

    //List<Emp> page(EmpQuery empQuery);


    //Emp findById(Integer id);

    //@Options(useGeneratedKeys = true,keyProperty = "id")//添加options注解启用主键回写功能)
    /*@AutoFill(OperationType.INSERT)
    void insert(Emp emp);*/

    /*@Select("select id, username, password, name, gender, phone, job, salary, image, entry_date, dept_id, create_time, update_time from emp")
    List<Emp> findAll();*/

    /*@AutoFill(OperationType.UPDATE)
    void update(Emp emp);*/

    //void delete(List<Integer> ids);

    /*@Select("select * from emp where emp.dept_Id = #{deptId};")
    List<Emp> findByDeptId(Integer deptId);*/

    @MapKey("job")
    List<Map<String, Object>> selJobReport();

    @MapKey("name")
    List<Map<String, Object>> selGenderReport();

    @MapKey("name")
    List<Map<String, Object>> selStudentDegreeReport();

    @MapKey("clazzName")
    List<Map<String, Object>> selStudentCountReport();

    /*@Select("select * from emp where username=#{username};")
    Emp selUsernameAndPassword(String username);*/
}
